import React, { memo } from 'react';
import {  useDispatch } from 'react-redux';
import { getSearchAction } from '../store/actionCreators';

import { Input } from 'antd';

const Search = Input.Search;


export default memo(function Form() {
 
  const dispatch = useDispatch()


  function searchChange(value) {
    dispatch(getSearchAction(value));
  }

  return (
    <Search
      placeholder="请输入搜索内容"
      style={{ marginBottom: '8px' }}
      onSearch={(value) => searchChange(value.trim())}
      enterButton
    />
  );
});
